#define _CRT_SECURE_NO_WARNINGS 1
#pragma warning(disable:4996)
#include<stdio.h>
int main(){
    int a, b;
    scanf("%d %d",&a,&b);
    int n = a ^ b;
    int cnt = 0;
    while (n) {
        cnt++;
        n= n& (n - 1);
    }
    printf("%d\n", cnt);
    return 0;
}